package  brwarner.game
{
	import fl.motion.Color;
	import flash.display.*;
	
	/**
	 * ...
	 * @author Brook Jensen
	 */
	public class GameState extends Sprite
	{
		//Background color
		private var _background:uint = 0xFFFFFF;
		
		//Is the state running
		private var _running:Boolean = false;
		
		//Parent game
		private var _game:Game;
		
		public function GameState( g:Game ) 
		{
			_game = g;
			redraw();
		}
		
		public function get game( ):Game
		{
			return _game;
		}
		
		public function update( ) : void { }
		public function resume( ) : void { }
		public function pause( ) : void { }
		
		public function get running( ) : Boolean
		{
			return _running;
		}
		public function set running( r:Boolean ) : void
		{
			_running = r;
			if ( r ) resume();
			else pause();
		}
		
		public function set bgcolor( c:uint ) : void
		{
			_background = c;
			redraw();
		}
		public function get bgcolor( ) : uint
		{
			return _background;
		}
		
		private function redraw( ) : void
		{
			graphics.clear();
			graphics.beginFill( _background );
			graphics.drawRect(0, 0, _game.width, _game.height );
			graphics.endFill();
		}
	}

}